<html>

<head>
    
  <script type="text/javascript" src="../../../../Scripts/jquery.js">
  </script>
    
  <script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
  </script>
    
  <script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
  </script>
    
  <script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
  </script>
    
  <script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
  </script>
    
  <link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
    
  <link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
  

  <title>ClipType</title>

  <link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">

    
  <script type="text/javascript" src="../../../../Scripts/bootstrap.js">
  </script>
  
</head>

<body bgcolor="#FFFFFF">
    
  <!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
    
  <!-- DO NOT EDIT MANUALLY !!! -->
  
  <table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
    <tr>
      <td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
      </td>
      <td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
      </td>
      <td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
      </td>
    </tr>
  </table>
  <h1>ClipType</h1>


  <p class="Decl"><span class="Comment">Del.&raquo;</span> <b>type</b> TClipType = (ctIntersection, ctUnion, ctDifference, ctXor);</p>

  <p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> <b>enum </b>ClipType { ctIntersection, ctUnion, ctDifference, ctXor };</p>

  <p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public enum</b> ClipType { ctIntersection, ctUnion, ctDifference, ctXor };</p>
<br>


  <p class="Body"> There are four boolean operations - AND, OR, NOT &amp; XOR.<br><br> Given that subject and clip polygon brush 'filling' is defined both by their vertices and their respective <a href="./PolyFillType.htm">filling rules</a>, the four boolean operations can be applied to polygons to define new filling regions: 
    <ul>
	
      <li>AND (intersection) - create regions where both subject <b>and</b> clip polygons are filled</li>
	
      <li>OR (union) - create regions where <b>either</b> subject <b>or</b> clip polygons (or both) are filled</li>
	
      <li>NOT (difference) - create regions where subject polygons are filled <b>except</b> where clip polygons are filled</li>
	
      <li>XOR (exclusive or) - create regions where <b>either</b> subject <b>or</b> clip polygons are filled <b>but not</b> where <b>both</b> are filled</li>

    </ul> <br> </p>


  <p class="Body"> <img src="../../../../Images/cliptype.png" width="175" height="200" alt=""><br> <img src="../../../../Images/intersection.png" width="175" height="200" alt="">&nbsp; <img src="../../../../Images/union.png" width="175" height="200" alt="">&nbsp; <img src="../../../../Images/difference.png" width="175" height="200" alt="">&nbsp; <img src="../../../../Images/xor.png" width="175" height="200" alt=""><br><br> All polygon clipping is performed with a <a href="../Classes/Clipper/_Body.htm">Clipper</a> object with the specific boolean operation indicated by the <em>ClipType</em> parameter passed in its <a href="../Classes/Clipper/Methods/Execute.htm">Execute</a> method. </p><br>


  <p class="Body"> With regard to <b>open</b> paths (polylines), clipping rules generally match those of closed paths (polygons).<br> However, when there are both polyline and polygon subjects, the following clipping rules apply: 
    <ul>
	
      <li>union operations - polylines will be clipped by any overlapping polygons so that non-overlapped portions will be returned in the solution together with the union-ed polygons</li>
	
      <li>intersection, difference and xor operations - polylines will be clipped only by 'clip' polygons and there will be not interaction between polylines and subject polygons.</li>

    </ul> </p><br>


  <p class="Body"> Example of clipping behaviour when mixing polyline and polygon subjects:<br> <img src="../../../../Images/line_clipping2.png"> </p>



  <h2 id="Auto-SeeAlso">See Also</h2>
  <p class="Body"><a href="../../../Overview/_Body.htm">Overview</a>, <a href="../Classes/Clipper/_Body.htm">Clipper</a>, <a href="../Classes/Clipper/Methods/Execute.htm">Clipper.Execute</a>, <a href="PolyFillType.htm">PolyFillType</a></p>
    
  <p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
  
</body>

</html>